The documentation for making modules with tabbed windows is separate from the main documentation for the sake of clarity, and because supporting tabbed windows is optional. If you intend to make a module with tabbed windows, you can first design the module to work without tabbed windows, then add tabbed windows at a later date.
Note that in this document, the word 'control' includes edit text items, radio buttons, checkboxes, pop-up menus and any other type of control item. A 'tab control' can refer to a row of tabs, or to a pop-up menu (which is acting as a tab control).
Introduction
A tabbed window allows a large number of dialog items to be used in a single window. The items are grouped into 'panes' (as in window panes), and one pane is displayed in the window at a time. A row of tabs allows the user to select a pane:
Alternatively, a pop-up menu can be used to select a pane (when there is not enough horizontal space in the window for a row of tabs):
ACE allows the user to choose between tabbed and non-tabbed windows (in the Preferences). A module does not have to support tabbed windows, but if it does, it must also provide a non-tabbed window, even if the non-tabbed window is very large.
Tabbed Window Implementation
A tabbed window is implemented as a 'root' dialog (which typically contains one dialog item, a tab control), plus a number of dialog panes. There is one root dialog for non-appearance manager systems ('DITL' id 130), and one for appearance manager systems ('DITL' id 131).
Note: You must have both root dialogs, even if you do not plan on having any appearance manager specific features in your tabbed window.
Each dialog pane is a separate 'DITL' resource. The first pane uses 'DITL' id 200, the second pane 'DITL' id 201 etc. If you want to use appearance manager specific controls in a dialog pane, create an additional 'DITL' with an id of +100.
Example: A tabbed window has three panes. The second pane uses a different control for appearance manager and non-appearance manager systems. Therefore there are four 'DITL' resources for the dialog panes, with id 200, 201, 202 and 301.
Note: Unlike the root dialogs, you do not need to have separate appearance and non-appearance dialog panes.
Each dialog pane ('DITL' resource) must be named. The names for the dialog panes must be the same as the names that appears in the 'tab#' resource, and in the pop-up menu tab control (if used).
Tab Control Implementation
The tab control must have a dialog item id of 1, and should be enabled.
For non-appearance manager root dialogs, the row of tabs is implemented as a user item, with a height of 20 pixels, and a width equal to the width of the dialog.
The pop-up menu and border is implemented as a standard pop-up menu (with associated 'CNTL' resource) and standard grey borders.
For appearance manager root dialogs, both the row of tabs and the pop-up menu and border are standard controls. Note that you must have a 'tab#' control for the row of tabs to display correctly.
See the section in "Development (part II)" for more information on these types of dialog items.
'Total' Dialog item id's and tabbed windows
For tabbed windows, the 'ACEi' resource uses 'total' dialog item id's. To determine the 'total' dialog item id for each of the controls, simply add all the dialog item id's in the root dialog, all the items in the preceding dialog panes, and any items with a lower id in the current dialog. This assumes that your controls appear in the dialog in the same order as their corresponding 'ACEc' resources.
Example: A root dialog consists of one tab control (item id 1). The first pane consists of two checkboxes (item id 1 and 2) and the second pane consists of a edit text item (item id 1), a static text item (item id 2) and a pop-up menu (item id 3). The resulting 'total' id for the controls is 2 and 3 (checkboxes), 4 (edit text) and 6 (pop-up menu).
Hint: Calculating the total dialog item id's is tedious and error prone. It is recommended that you finalise the layout of your dialog panes before creating your 'ACEi' resource.
Positioning tab controls in root dialogs
If the tab control is implemented as a 'row of tabs', it should be positioned as follows: For the non-appearance root dialog, position the user item at Top:10, Left:0. The width of the user item should be the same as the width of the dialog, and the height of the user item should be 20. For the appearance manager root dialog, position the row of tabs at Top:10, Left -1. The width should be 2 pixels greater than the width of the dialog, and the height should be equal to the dialog height - 9. This ensures that black border around the row of tabs is not visible (which is the correct behaviour for a row of tabs in this situation).
If the tab control is implemented as a pop-up menu (with the associated grey border), it should be positioned so that the top of the pop-up menu is 10 pixels from the top of the dialog, and the grey border is 10 pixels from the left edge of the dialog.
Positioning dialog items in dialog panes
The position of a dialog item in a dialog pane determines it's position when it is placed in the root dialog.
Example: An item in the second dialog pane, positioned at Top:45, Left:20 will appear in the root dialog at Top:45, Left:20.
The items in the dialog panes should be offset at Top:45, Left:20 if the tab control is a pop-up menu tab controls, and Top:45, Left:10 if the tab control is a row of tabs.